/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.servicesDirectory.dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;


/**
 * @author TuMC6B
 *
 */
public class BaseDAOImpl implements BaseDAO {
	public void closeConnection(Connection con, Statement st) {
		try {
			con.close();
			st.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}
	public Connection getConnection() {
		// TODO Auto-generated method stub
		Connection con=null;
		try {
			Class.forName(JDBC_DRIVER);
		} catch (java.lang.ClassNotFoundException e) {
			e.printStackTrace();
		}

		try {
			con = DriverManager.getConnection(URL, USER_NAME, PASSWORD);
		} catch (SQLException ex) {
			ex.printStackTrace();
		}
		return con;
	}
}
